#####################################################################
# Product:      KnowledgeEngine (Plone Edition)
#
# File:         User.py
#
# Copyright:    Copyright (c) 2004, Faulkner Technologies
#
# Author:       Brian Oliver
#
# Description:  A KnowledgeEngine 'User' encapsulates the standard
#               requirements for the concepts of a User.
#
# See Also:     UserProviderService, GroupProviderService,
#               SecurityService, Permission
#####################################################################

#####################################################################
## KnowledgeEngine Library Imports
from Common import *

#####################################################################
## Zope Library Imports
from Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from AccessControl.Role import RoleManager
 
#####################################################################
## Python Library Imports
# (none)

#####################################################################
## User Class Definition
class User(RoleManager):
    """
        An object to holder transitent User information.
        
        Created by a UserProviderService
    """
        
    #---------------------------------------------------------------#

    #declare security so ClassInfo may be accessed in DTML/ZPT etc
    security = ClassSecurityInfo()
    security.declareObjectPublic()
    security.setDefaultAccess("allow")

    #---------------------------------------------------------------#

    def __init__(self, userIdentity, fullname, email):
        """
            All users require an identity (probably from an external system),
            a fullname and an email address.
        """
        
        self.userIdentity = userIdentity
        self.fullname = fullname
        self.email = email

    #---------------------------------------------------------------#

    def getIdentity(self):
        """
            Returns the unique identity for the user
            
            RETURN TYPE: String
        """
        
        return self.userIdentity

    #---------------------------------------------------------------#

    def getFullname(self):
        """
            Returns the fullname for the user
            
            RETURN TYPE: String
        """
        
        return self.fullname
               
    #---------------------------------------------------------------#
        
    def getEmail(self):
        """
            Returns the email address of the user
           
            RETURN TYPE: String
        """
        
        return self.email
               
    #---------------------------------------------------------------#
        
#####################################################################
## Class Initialisation
InitializeClass(User)
